home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MISC.SWG / 0037_Produce DOS Error Message.pas < prev    next >
Pascal/Delphi Source File  |  1993-09-26  |  2KB  |  48 lines

  1. {*****************************************************************************
  2.  * Function ...... ErrorMsg()
  3.  * Purpose ....... To produce a DOS error message based on the error code
  4.  * Parameters .... ErrorCode       DOS error code
  5.  * Returns ....... Error message assosiated with passed code
  6.  * Notes ......... Uses function ITOS
  7.  * Author ........ Martin Richardson
  8.  * Date .......... May 13, 1992
  9.  *****************************************************************************}
  10. FUNCTION ErrorMsg( ErrorCode: INTEGER ): STRING;
  11. BEGIN
  12.      CASE ErrorCode OF
  13.           0: ErrorMsg := 'No Error';
  14.           2: ErrorMsg := 'File Not Found';
  15.           3: ErrorMsg := 'Path Not Found';
  16.           4: ErrorMsg := 'Too Many Open Files';
  17.           5: ErrorMsg := 'File Access Denied';
  18.           6: ErrorMsg := 'Invalid File Handle';
  19.          12: ErrorMsg := 'Invalid File Access Code';
  20.          15: ErrorMsg := 'Invalid Drive Number';
  21.          16: ErrorMsg := 'Cannot Remove Current Directory';
  22.          17: ErrorMsg := 'Cannot Rename Across Drives';
  23.          18: ErrorMsg := 'File access error';
  24.         100: ErrorMsg := 'Disk Read Error';
  25.         101: ErrorMsg := 'Disk Write Error';
  26.         102: ErrorMsg := 'File Not Assigned';
  27.         103: ErrorMsg := 'File Not Open';
  28.         104: ErrorMsg := 'File Not Open For Input';
  29.         105: ErrorMsg := 'File Not Open For Output';
  30.         106: ErrorMsg := 'Invalid Numeric Format';
  31.         150: ErrorMsg := 'Disk Is Write-Protected';
  32.         151: ErrorMsg := 'Unknown Unit';
  33.         152: ErrorMsg := 'Drive Not Ready';
  34.         153: ErrorMsg := 'Unknown Command';
  35.         154: ErrorMsg := 'CRC Error In Data';
  36.         155: ErrorMsg := 'Bad Drive Request Structure Length';
  37.         156: ErrorMsg := 'Disk Seek Error';
  38.         157: ErrorMsg := 'Unknown Media Type';
  39.         158: ErrorMsg := 'Sector Not Found';
  40.         159: ErrorMsg := 'Printer Out Of Paper';
  41.         160: ErrorMsg := 'Device Write Fault';
  42.         161: ErrorMsg := 'Device Read Fault';
  43.         162: ErrorMsg := 'Hardware Failure';
  44.         ELSE ErrorMsg := 'Error Number: ' + ITOS( ErrorCode, 0 );
  45.     END; { CASE }
  46. END;
  47.  
  48.